<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
          rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
</head>
<body>
<table class="table">
    <thead>
        <tr>
            <th scope="col">#</th>
            <th scope="col">ID</th>
            <th scope="col">用户名</th>
            <th scope="col">邮箱</th>
            <th scope="col">年龄</th>
            <th scope="col">角色</th>
            <th scope="col">stats</th>
        </tr>
    </thead>
    <tbody>
    <tr th:each="per,stats : ${persons}">
        <td th:text="${stats.count}"></td>
        <td th:text="${per.id}"></td>
        <td>[[${per.userName}]]</td>
        <td th:text="${per.email}"></td>
        <td>
            <sapn th:if="${per.age ge 18}" th:text="|${per.age}/成年|"></sapn>
            <sapn th:if="${per.age lt 18}" th:text="|${per.age}/未成年|"></sapn>
        </td>
        <td>
            <span  th:if="${per.role == 'pm'}">财务</span>
            <span  th:if="${per.role == 'hr'}">人资</span>
            <span  th:if="${per.role == 'admin'}">超管</span>
        </td>
        <td>
            index: [[${stats.index}]] <br/>
            count: [[${stats.count}]] <br/>
            size（总数量）: [[${stats.size}]] <br/>
            current(当前对象): [[${stats.current}]] <br/>
            even(true)/odd(false): [[${stats.even}]] <br/>
            first: [[${stats.first}]] <br/>
            last: [[${stats.last}]] <br/>
        </td>
    </tr>
    </tbody>
</table>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-/mhDoLbDldZc3qpsJHpLogda//BVZbgYuw6kof4u2FrCedxOtgRZDTHgHUhOCVim" crossorigin="anonymous"></script>
</body>
</html>